// src/api/content.js
export const checkSensitiveWords = async (text) => {
  const res = await fetch('http://localhost:3000/api/content/check', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ text })
  });
  const data = await res.json();
  console.log('网易易盾', data)

  if (data.code !== 200) throw new Error(data.message || '检测失败');
  return data.data; // { safe: true } 或 { safe: false, keywords: [...] }
};